package xyz.lilei123.sessiondemo.dto;

import org.springframework.util.StringUtils;

import java.util.Objects;

/**
 * @author jack
 * @version 1.0
 * @date 05/09/2021 15:46
 **/
public class UserDto {

    private String id;

    private String username;

    private String password;


    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPassword() {
        return password;
    }

    public void setPassword(String password) {
        this.password = password;
    }

    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    public boolean checkPassword(UserDto userDto){
        return !StringUtils.isEmpty(userDto.getPassword()) && Objects.equals(this.password, userDto.getPassword());
    }


}
